-
-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] replicate swagger-ui problem and hacky solution #1889
base: main
Are you sure you want to change the base?
Conversation
Thanks @jdkent, but the tests are still failing with your fix. Note that we do have tests for relative refs, so not sure why this is failing. If there is an issue, I assume it is in the ref resolving, and we should fix it there. |
thanks for pointing towards an existing test, for a more minimal example, try cloning the specification in the test: def test_relative_refs(relative_refs, spec):
spec_path = relative_refs / spec
specification = Specification.load(spec_path)
assert "$ref" not in specification.raw
# clone specification
specification_clone = specification.clone()
assert "$ref" not in specification_clone.raw The clone step will fail since I could see a solution where base_uri is an optional argument passed with clone, or some reversion of this pull request (#1830), but I do not know what problem that pull request was specifically fixing. |
if I change the clone function back to: def clone(self):
return type(self)(copy.deepcopy(self._spec)) and run this test from def test_simple(swagger_ui_app):
app_client = swagger_ui_app.test_client()
response = app_client.get("/v1.0/spec.json")
assert response.status_code == 200 the tests still pass, so I'm unsure what the minimal example that makes deepcopying |
This seems related to my issue. Unsure. #1909 |
Fixes #1890 .
Changes proposed in this pull request:
add external reference to simple apptry to clone with raw spec, unless there are external referencesI'm unsure what the specific problem was in Connexion3 Failed to load API definition in the Swagger UI #1829 so I don't know how to differentiate use cases.